2025-06-12
work directory on your GitHub repository fork“What causes mothers to receive comprehensive postnatal care?”
DAGs help us:
Having a good idea of the causal structure of a question helps us know what to visualize.
DAGs:
We can use the daggity R package to visualize the the causal structure of the problems around the motivating research question
complete_dag <- dagify(
RCP ~ PQ + PC + WTP + PT + RA + RP,
PQ ~ PEC,
PC ~ DEP + JOB + INC + DIS,
WTP ~ PQ + INC + INS + RA + CO,
PT ~ PQ + RE + CO,
RA ~ PQ + RP + INS,
RP ~ PQ + AGE + OBE + MG + DM + HD + PP + PR + HT + GHT,
PEC ~ ST,
DEP ~ INC + JOB + CO,
JOB ~ EDU + CO + R + M + I + CC,
DIS ~ PEC,
INC ~ JOB + EDU + RE + PEC + AGE,
INS ~ JOB + PEC + AGE,
CO ~ PED + PIN + REL + PEC + CC,
PIN ~ PEC + PED,
EDU ~ PED + PIN + R + M + I + CC,
R ~ PR,
M ~ PM,
I ~ PI,
CC ~ PCC,
REL ~ RE,
OBE ~ PEC + AGE,
MG ~ AGE + OBE,
DM ~ AGE + OBE + INC,
HD ~ AGE + OBE + DM,
PP ~ AGE + MG,
PR ~ AGE + HT + GHT + MG,
HT ~ AGE + OBE,
GHT ~ HT + MG
)examples/dag_sim_data.qmd we simulated data that encodes the DAG structure.ggplot themes Staying DRYggplot_themes_and_staying_dry.qmd we explore how to make a ggplot themestay DRY (Don’t Repeat Yourself) when working with multifile notebookssaving_visualizations.qmd I show how to export/save visualizationsapplications_1_effective_and_honest_scales.qmd we look at how to use scales and position effectivelyapplications_2_choropleths_for_spatial_data.qmd we create a choropleth map of the United States using the simulated data from aboveapplications_3_dot_plot_for_spatial_data.qmd we create a dot plot of the data using the same simulated data.applications_4_distribution_plots.qmd we examine distributions of variablesapplications_5_visualizing_time_trends.qmd we examine time trends of variablesapplications_6_visualizing_correlations_and_models.qmd we visualize correlations and model outputsGraduate Summer Institute of Epidemiology and Biostatistics